oracle.pgx.config

## Class AbstractGraphConfigFactory<T extends GraphConfig>

- java.lang.Object
- - oracle.pgx.config.AbstractGraphConfigFactory<T>

- Type Parameters:
    `T` - the type of graph configuration this factory creates.
  Direct Known Subclasses:
    AbstractPgGraphConfigFactory, AnyFormatGraphConfigFactory, FileGraphConfigFactory, TwoTablesGraphConfigFactory

      public abstract class AbstractGraphConfigFactory<T extends GraphConfig>
      extends Object

  Base factory class for creating graph configuration objects.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractGraphConfigFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `fromClasspath(String path)` Parses a graph config given as classpath path to a JSON file.
    `T` | `fromFile(File file)` Parses a graph config given as JSON file.
    `T` | `fromFilePath(String path)` Parses a graph config given as path to a JSON file.
    `T` | `fromHdfs(String hdfsPath)` Parses a graph config given as HDFS file path to a JSON file.
    `T` | `fromHttp(String httpPath)` Parses a graph config given as HTTP url path to a JSON file.
    `T` | `fromInputStream(InputStream is)` same as `fromInputStream(InputStream, File)`, but with `null` passed as parent
    `T` | `fromInputStream(InputStream is, File parent)` Parses a graph config given as input stream.
    `T` | `fromJson(String json)` Same as `fromJson(String, File)`, but with `null` passed as parent.
    `T` | `fromJson(String json, File parent)` Parses a graph config given as JSON string.
    `T` | `fromPath(String path)` Parses a graph config given as path.
    `T` | `fromProperties(InputStream is)` same as `fromProperties(Properties)`, but instantiates a new `Properties` object from the given `InputStream`.
    `abstract T` | `fromProperties(Properties props)` Parses a graph config given as `Properties` file.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractGraphConfigFactory

          public AbstractGraphConfigFactory()

  - ### Method Detail

    - #### fromClasspath

          public final T fromClasspath(String path)
                                                    throws IOException

      Parses a graph config given as classpath path to a JSON file. Note: relative path resolving not yet supported. Use absolute paths inside given JSON only.
      Parameters:
        `path` - the path on the classpath
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given file

    - #### fromFile

          public final T fromFile(File file)
                                               throws IOException

      Parses a graph config given as JSON file. Relative paths found in JSON are resolved relative to given file.
      Parameters:
        `file` - the input file
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given file

    - #### fromFilePath

          public final T fromFilePath(String path)
                                                   throws IOException

      Parses a graph config given as path to a JSON file. Relative paths found in JSON are resolved relative to given file.
      Parameters:
        `path` - the path to the JSON file
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given file

    - #### fromHdfs

          public final T fromHdfs(String hdfsPath)
                                               throws IOException

      Parses a graph config given as HDFS file path to a JSON file. Note: relative path resolving currently not yet supported. Use absolute paths inside given JSON only.
      Parameters:
        `hdfsPath` - the HDFS path, e.g. hdfs:/hdfs-hostname:8080/path/to/config.json. Host name and port can be omitted if corresponding Hadoop configuration files are on current classpath. See Hadoop configuration documentation for details.
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given file

    - #### fromHttp

          public final T fromHttp(String httpPath)
                                               throws IOException

      Parses a graph config given as HTTP url path to a JSON file.
      Parameters:
        `httpPath` - HTTP url path, e.g. http://my-host.com/path/to/config.json
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given file

    - #### fromInputStream

          public final T fromInputStream(InputStream is)
                                                      throws IOException

      same as `fromInputStream(InputStream, File)`, but with `null` passed as parent
      Parameters:
        `is` - the input stream to read
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given input stream

    - #### fromInputStream

          public final T fromInputStream(InputStream is,
                          File parent)
                                                      throws IOException

      Parses a graph config given as input stream.
      Parameters:
        `is` - the input stream to read
        `parent` - if not `null`, relative paths found in config will resolved against this parent
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given input stream

    - #### fromJson

          public final T fromJson(String json)
                                               throws IOException

      Same as `fromJson(String, File)`, but with `null` passed as parent.
      Parameters:
        `json` - the input JSON string
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given JSON string

    - #### fromJson

          public final T fromJson(String json,
                   File parent)
                                               throws IOException

      Parses a graph config given as JSON string.
      Parameters:
        `json` - the input JSON string
        `parent` - if not `null`, relative paths found in config will resolved against this parent
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given JSON string

    - #### fromPath

          public final T fromPath(String path)
                                               throws IOException

      Parses a graph config given as path. Detects the `Protocol` of given path by looking at path handler.
      Parameters:
        `path` - the path to parse from
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given path

    - #### fromProperties

          public final T fromProperties(InputStream is)
                                                     throws IOException

      same as `fromProperties(Properties)`, but instantiates a new `Properties` object from the given `InputStream`.
      Parameters:
        `is` - the input stream containing graph configuration in `Properties` format.
      Returns:
        the graph configuration object
      Throws:
        `IOException` - if there was any I/O error during reading given input stream

    - #### fromProperties

          public abstract T fromProperties(Properties props)

      Parses a graph config given as `Properties` file.
      Parameters:
        `props` - the input properties
      Returns:
        the graph configuration object

Copyright © 2015. All rights reserved.